<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset="UTF-8">
<title>列表渲染</title>
<script src='./vue.js'></script>
</head>
<body>
<div id="app">
<div v-for="(item,index) of list":key="item.id">{{item}}---{{index}}</div>
</div>
<script>
var vm=new Vue({
el:"#app",
data:{
list:[
{
id:"012",
text:"hello"
},
{
id:"013",
text:"world"
},
{
id:"015",
text:"haha"
}
]
}
})
</script>
</body>